package cn.edu.nju.software.zp13.client.assignment3.xmlGenerator;

import java.util.HashMap;
import java.util.Map;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Strategy class takes responsibility of generating concrete DOM tree.
 * 
 * @author Ivan
 *
 */
public abstract class XmlContentStrategy {
	protected Map<String, String> namespace = new HashMap<>();

	protected void addNamespace(Element root) {
		namespace.forEach((k, v) -> {
			root.setAttribute(k, v);
		});
	}

	protected abstract void processDom(Document dom);

	protected Map<String, String> getNamespace() {
		return namespace;
	}

}
